package com.tide.crm.dto;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public class ResponseInfo<T> implements Serializable {

	private static final long serialVersionUID = -4417715614021482064L;

	private String code;
	private String message;

	private T data;

	private transient static ResponseInfo successResponse = new ResponseInfo(StatusCode.SUCCESS, true);
	
	public ResponseInfo(String code, String message) {
		super();
		this.code = code;
		this.message = message;
	}
	
	public ResponseInfo(StatusCode statusCode, boolean success) {
		code = statusCode.getCode();
		message = statusCode.getMsg();
	}

	public ResponseInfo() {
		// TODO Auto-generated constructor stub
		
	}

	@Override
	public String toString() {
		return "ResponseInfo [code=" + code + ", message=" + message + ", data=" + data + "]";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public T getData() {
		return data == null ? (T) new String() : data;
	}

	public void setData(T data) {
		this.data = data;
	}

	

}
